package ua.kharkov.khpi.tarasenko.bach.dao.core.order;

import java.io.Serializable;

import ua.kharkov.khpi.tarasenko.bach.core.order.OrderStatus;

/**
 * Represents order-user's instance.
 * 
 * @author oleksandr
 * 
 */
public class OrderUserDTO implements Serializable{
	private static final long serialVersionUID = -2331969938148555217L;
	
	private int orderId;
	private int userId;
	private java.util.Date orderDate;
	private OrderStatus status;

	public int getUserId() {
		return userId;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

	public java.util.Date getOrderDate() {
		return orderDate;
	}

	public void setOrderDate(java.util.Date orderDate) {
		this.orderDate = orderDate;
	}

	public OrderStatus getStatus() {
		return status;
	}

	public void setStatus(OrderStatus status) {
		this.status = status;
	}
	
	public void setStatus(int statusId) {
		this.status = OrderStatus.getOrderStatusById(statusId);
	}
	
	public int getOrderId() {
		return orderId;
	}
	
	public void setOrderId(int orderId) {
		this.orderId = orderId;
	}

	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("User id=");
		builder.append(userId);
		builder.append("\n");
		builder.append("Order id=");
		builder.append(orderId);
		builder.append("\n");
		builder.append("Order date=");
		builder.append(orderDate);
		builder.append("\n");
		builder.append("Order status=");
		builder.append(status);
		builder.append("\n");
		return builder.toString();
	}
}
